<?php

class spList extends spDiv
{
	private $lst;  // either ul or ol (default ul)

	public function __construct( $data )
	{
		parent::__construct();
		
		$this->lst = new spUnorderedList;
		parent::addChild( $this->lst );
		
		if ( isset($data["class"]) )
		{
			$this->lst->setClass( $data["class"] );
		}
		
		if ( isset($data["items"]) )
		{
			foreach ( $data["items"] as $text )
			{
				$this->addItemText( $text );
			}
		}
	}
	
	public function addItemText( $text )
	{
		$li = new spListItem(array(
			"content" => $text
		));
		$this->lst->addChild( $li );
	}
}

?>